from flask import Flask
import config
from exts import db, mail
from models import UserModel
from blueprint.auth import bp
from flask_migrate import Migrate
from flask_cors import CORS

app = Flask(__name__)
CORS(app)
app.config.from_object(config) #绑定配置文件

#flask db init
#flask db migrate
#flask db upgrade

db.init_app(app)  #绑定数据库
migrate = Migrate(app, db) #映射数据库

mail.init_app(app)

app.register_blueprint(bp) #注册蓝图

@app.route('/')
def hello():
    return "hello"

if __name__ == '__main__':
    app.run(debug=True)